<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>商家月报表</title>
</head>
<body>
<div ng-app="myApp" ng-controller="MonthCtrl">
    <ui-form key="pieceAdd" column="2">
        <input name="id" type="hidden" value="${pieceRange.id}"/>
        <ui-form-input name="nickname" label="规则别名:" value="${pieceRange.nickname}"></ui-form-input>
        <ui-form-input name="code" label="规则简码:"  value="${pieceRange.code}"></ui-form-input>
        <ui-form-input name="supplierCode" label="供货商编码:"  value="${pieceRange.supplierCode}"></ui-form-input>
        <ui-form-select name="direction" label="运单配送类型" value="${pieceRange.direction}">
            <option value="">请选择签收方式</option>
            <option value="0">配送</option>
            <option value="1">上门换</option>
            <option value="2">上门退</option>
        </ui-form-select>
        <ui-form-select name="settlement_type" label="机构类型:" value="${pieceRange.settlement_type}">
            <option value="">请选择机构类型</option>
            <option value="0">自营</option>
            <option value="1">合作站</option>
            <option value="2">合作商</option>
            <option value="3">大型合作商</option>
        </ui-form-select>
        <ui-form-select name="temperature" label="运输温度等级" value="${pieceRange.temperature}">
            <option value="">请选择运输温度等级</option>
            <option value="0">常温</option>
            <option value="1">生鲜冷链</option>
        </ui-form-select>
        <ui-form-select name="packageSize" label="包裹大小规格" value="${pieceRange.packageSize}">
            <option value="">请选择包裹大小规格</option>
            <option value="1">小件</option>
            <option value="2">大件</option>
        </ui-form-select>
        <ui-form-select name="signer" label="签收方式" value="${pieceRange.signer}">
            <option value="">请选择签收方式</option>
            <option value="0">代签</option>
            <option value="1">本人签收</option>
        </ui-form-select>
        <ui-form-select name="expressScheduleType" label="配送时效要求:" value="${pieceRange.expressScheduleType}">
            <option value="">请选择配送时效要求</option>
            <option value="0">未知</option>
            <option value="1">当日达</option>
            <option value="2">次晨达</option>
            <option value="3">三日达</option>
            <option value="4">工作日</option>
            <option value="5">节假日</option>
            <option value="6">夜间配</option>
            <option value="7">上午达</option>
            <option value="8">下午达</option>
        </ui-form-select>
        <ui-form-input name="firstPrice" label="首件价格:" value="${pieceRange.firstPrice}"></ui-form-input>
        <ui-form-input name="secondPrice" label="拖件价格:" value="${pieceRange.secondPrice}"></ui-form-input>
        <ui-form-input name="provinceCode" label="省直辖市编码:" value="${pieceRange.provinceCode}"></ui-form-input>
        <ui-form-input name="startTime" label="启用时间:" value="${pieceRange.startTime}"></ui-form-input>
        <ui-form-input name="endTime" label="关闭时间:" value="${pieceRange.endTime}"></ui-form-input>
    </ui-form>
</div>
<script>
    angular.module('myApp', ['ui.form']);
    angular.module('myApp').controller('MonthCtrl', function ($scope) {
        $scope.$on('ui.form.submit',function (event,param) {
            $.ajax({
                url:"<%=request.getContextPath()%>/monthreport/update",
                type:"post",
                data:param
            }).done(function (result) {
                if(result.code == '0000'){
                    toastr.success(result.msg);
                }else{
                    toastr.error(result.msg);
                }
            }).fail(function (err) {

            });
        })
    });
</script>
</body>
</html>